<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="/static/css/style.css" rel="stylesheet" type="text/css" />
<link href="/static/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript" src="/static/js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="/static/js/select-ui.min.js"></script>
<script type="text/javascript" src="/static/editor/kindeditor.js"></script>

<script type="text/javascript">
	KE.show (
    {
        id : 'content7',cssPath : './index.css'
    } );
    $ ( document ).ready ( function ( e )
    {
	    $ ( ".select1" ).uedSelect (
	    {
		    width : 345
	    } );
	    $ ( ".select2" ).uedSelect (
	    {
		    width : 167
	    } );
	    $ ( ".select3" ).uedSelect (
	    {
		    width : 100
	    } );
    } );
</script>
</head>

<body>
		<div class="place">
				<span>位置：</span>
				<ul class="placeul">
						<li><a href="#">首页</a></li>
						<li><a href="#">系统设置</a></li>
				</ul>
		</div>
		<div class="formbody">
				<ul class="forminfo">
						<c:if test="${users.id == null }">
								<div class="formtitle">
										<span>新 用 户</span>
								</div>
						</c:if>
						<c:if test="${users.id != null }">
								<div class="formtitle">
										<span>更 新 用 户</span>
								</div>
						</c:if>
						<form:form action="/users" method="POST" modelAttribute="users">

								<form:errors path="*"></form:errors>

								<c:if test="${users.id != null }">
										<li><label>用户编号<b>：</b></label> <form:input path="id" class="dfinput" readonly="true" /></li>
										<input type="hidden" name="_method" value="PUT" />
								</c:if>

								<li><label>用户名称<b>：</b></label> <form:input path="username" class="dfinput" /> <form:errors
												path="username"></form:errors></li>

								<li><label>用户密码<b>：</b></label> <form:password path="password" class="dfinput" /> <form:errors
												path="password"></form:errors></li>

								<security:authorize ifAnyGranted="ROLE_ADMIN">
										<li><label>账户状态<b>：</b></label></li>
										<form:radiobuttons path="status" items="${status }" delimiter=" " />

										<li><label>账户权限<b>：</b></label></li>
										<form:checkboxes path="descn" items="${desc }" />

										<li><label>账户描述<b>：</b></label> <textarea id="content7" name="content"
														style="width: 700px; height: 250px; visibility: hidden;"></textarea></li>

										<c:if test="${users.id != null }">
												<li><label>&nbsp;</label> <input type="submit" value="更    新"
																class="btn btn-primary  pull-right" onclick="javascript:location.href='/showUsers';" /></li>
										</c:if>
								</security:authorize>

								<c:if test="${users.id == null }">
										<li><label>&nbsp;</label> <input type="submit" value="注     册" class="btn" /></li>

										<li><label>&nbsp;</label> <a class="tablelink" href="terms-and-conditions.html">用户协议</a>&nbsp;
												&nbsp; <input type="checkbox" class="remember-me" />&nbsp; 我同意</li>

										<li><label>&nbsp;</label><a class="tablelink" href="privacy-policy.html">使用说明</a></li>

								</c:if>
						</form:form>
				</ul>
		</div>

		<script type="text/javascript">
			$ ( "#usual1 ul" ).idTabs ( );
		</script>

		<script type="text/javascript">
			$ ( '.tablelist tbody tr:odd' ).addClass ( 'odd' );
		</script>

</body>

</html>
